package com.peng.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//如果要扩展springMvc 官方建议这样去做
@Configuration
public class MyMvcConfig1 implements WebMvcConfigurer {
    //视图跳转
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/peng").setViewName("test");
        //浏览器输localhost:8080/peng 就会跳到test.html页面
    }
}
